CC = gcc
CFLAGS = -Werror

all: libuthreads.a

libuthreads.a: user_threads.o user_io.o user_mutex.o thread_list.o
	ar rcs libuthreads.a user_threads.o user_io.o thread_list.o user_mutex.o

user_threads.o: user_threads.c user_threads.h user_mutex.h thread_list.h common.h
	$(CC) $(CFLAGS) -c $*.c

user_mutex.o: user_mutex.c user_mutex.h user_threads.h common.h thread_list.h
	${CC} ${CFLAGS} -c $*.c

user_io.o: user_io.c user_io.h user_threads.h user_mutex.h common.h thread_list.h
	${CC} ${CFLAGS} -c $*.c

thread_list.o: thread_list.c common.h
	${CC} ${CFLAGS} -c $*.c
 


